package interfaces.superWidgets;

import interfaces.GUISource;

import org.fenggui.Container;
import org.fenggui.binding.render.ImageFont;
import org.fenggui.composite.Window;

public class InterfaceWindow extends Window {
	
	protected InterfaceContainer content;
	
	public InterfaceWindow(boolean closeButton, String title) {
		super(closeButton, false, false, true);
		
		setTitle(title);
		
		GUISource.setTheme(this);
		
		content = new InterfaceContainer();
		setContentContainer(content);
		
		setTitleFont(GUISource.bigFont);
		
		if(closeButton) GUISource.setTheme(this.closeButton);
	}
	
	protected void setTitleFont(ImageFont font) {
		if(title != null && !title.equals("")) GUISource.setFont(getTitleLabel(), font);
	}
	
	public void addToContainer(Container content) {
		assert(content != null);
		content.addWidget(this);
		setResizable(false);
		setMovable(false);
	}
}